fetch('http://chst.vip:1234/api/getinlanddiscount')
.then(function(c){
    return c.json();
})
.then(function(b){
    console.log(b);
    let str=''
    b.result.forEach(item => {
        str +=` <li productId=${item.productId}>
                    ${item.productImg}
                    <div>${item.productName}</div>
                    <div>${item.productPrice}</div>
                    <div>${item.productFrom}|${item.productTime}</div>
                </li>`
    });
    $('ul').html(str)
})
.then(function(){
    $('ul').on('click','li',function(){
        let productId = $(this).attr('productId')
        console.log(productId);
        location.href='./inlanddiscount_1.html?productId='+productId;
    })
})